function printOrder(orderNo) {
	var LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
	createOrder(LODOP,orderNo);
	LODOP.PRINT_DESIGN();
}

function createOrder(LODOP,orderNo) {
	var style = $("#printStyle").html().toString().replace(/\r\n/g, "").replace(/\n/g, "");
	style = "<style>" + style + "</style>";
	LODOP.PRINT_INITA(1, 8, 793, 1122, "订单" +　orderNo + "(A)");

	LODOP.ADD_PRINT_HTM(20, 0, 750, 100, style + "<body>"
			+ $("#pageHead").html() + "</body>");
	LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);

	commonOrderContent(LODOP, style);

	LODOP.ADD_PRINT_HTM(1020, 0, 750, 60, style + "<body>"
			+ $("#pageFooter").html() + "</body>");
	LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);

	LODOP.ADD_PRINT_TEXT(1050, 720, 60, 20, "#/&");
	LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
};

function printOrderOnLetterPaper(orderNo) {
	var LODOP = getLodop(document.getElementById('LODOP'), document
			.getElementById('LODOP_EM'));
	createOrderOnLetterPaper(LODOP,orderNo);
	LODOP.PRINT_DESIGN();
}

function commonOrderContent(LODOP, style) {
	LODOP.ADD_PRINT_HTM(130, 0, 750, 220, style + "<body>"
			+ $("#printHead").html() + "</body>");
	LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
	LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);

	LODOP.ADD_PRINT_TABLE(380, 0, 750, "BottomMargin:60px", style + "<body>"
			+ $("#tableArea").html() + "</body>");
	LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
	LODOP.SET_PRINT_STYLEA(0, "Top2Offset", -60);

	LODOP.ADD_PRINT_HTM(10, 0, 750, 80, style + "<body>" + $("#remark").html()
			+ "</body>");
	LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);

	LODOP.ADD_PRINT_HTM(10, 0, 750, 230, style + "<body>"
			+ $("#printFooter").html() + "</body>");
	LODOP.SET_PRINT_STYLEA(0, "LinkedItem", -1);
}

function createOrderOnLetterPaper(LODOP,orderNo) {
	var style = $("#printStyle").html().toString().replace(/\r\n/g, "")
			.replace(/\n/g, "");
	style = "<style>" + style + "div{font-family:'楷体'}" + "</style>";
	LODOP.PRINT_INITA(1, 0, 793, 1122, "订单" +　orderNo +  + "(B)");
	commonOrderContent(LODOP, style);
}

//Packing
function printPacking(packingNo){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createPacking(LODOP,packingNo);
    LODOP.PRINT_DESIGN();
}

function createPacking(LODOP,packingNo){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
	  style = "<style>"+ style + "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"装箱单" +packingNo + "(A)");
	  
	  LODOP.ADD_PRINT_HTM(20,0,750,120,style + "<body>" + $("#pageHead").html()+ "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      commonPackingContent(LODOP,style);
      
      LODOP.ADD_PRINT_HTM(1030, 0, 750, 60, style + "<body>"
  			+ $("#pageFooter").html() + "</body>");
  	  LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);

  	  LODOP.ADD_PRINT_TEXT(1050, 720, 60, 20, "#/&");
      LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
};

function printPackingOnLetterPaper(packingNo){
   var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
   createPackingOnLetterPaper(LODOP,packingNo);
   LODOP.PRINT_DESIGN();
}

function commonPackingContent(LODOP,style){
   var printHead_height= $("#printHead").height(); 
	 
   LODOP.ADD_PRINT_HTM(120,0,750,printHead_height,style + "<body>" + $("#printHead").html()+ "</body>");
   LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
   
   LODOP.ADD_PRINT_TABLE(printHead_height + 130,0,750,"BottomMargin:60px",style + "<body>" + $("#tableArea").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
   
   LODOP.ADD_PRINT_HTM(10,0,750,100,style + "<body>" +$("#remark").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1);
   LODOP.SET_PRINT_STYLEA(0,"Vorient",1);
}

function createPackingOnLetterPaper(LODOP,packingNo){
   var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
   style = "<style>"+ style + "</style>";
   LODOP.PRINT_INITA(1,0,793,1122,"装箱单" +packingNo　+　"(B)");
   
   commonPackingContent(LODOP,style);
}

//Purchase

function printPurchase(purchaseNo){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createPurchase(LODOP,purchaseNo);
    LODOP.PRINT_DESIGN();
}


function createPurchase(LODOP,purchaseNo){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
	  style = "<style>"+ style + "div{font-family:'楷体'}"+ "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"采购单" + purchaseNo + "(A)");
	  
	  LODOP.ADD_PRINT_HTM(20,10,750,120, style + "<body>" +  $("#pageHead").html() + "</body>");
	  LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      LODOP.ADD_PRINT_HTM(120,10,750,220, style + "<body>" +  $("#printHead").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      LODOP.ADD_PRINT_TABLE(450,10,750,"BottomMargin:25px",style + "<body>" + $("#tableArea").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
      LODOP.SET_PRINT_STYLEA(0,"Top2Offset",-80);
      
      
      LODOP.ADD_PRINT_HTM(10,0,750,100,style + "<body>" +$("#contractContent").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1);
      LODOP.SET_PRINT_STYLEA(0,"Vorient",1);
      
      LODOP.ADD_PRINT_TEXT(1060, 720, 60, 20, "#/&");
  	  LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
};

//Sample
function printSample(sampleNo){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createSample(LODOP,sampleNo);
    LODOP.PRINT_DESIGN();
}

function createSample(LODOP,sampleNo){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
	  style = "<style>"+ style + "</style>";
	  LODOP.PRINT_INITA(1,0,793,800,"快递发票" + sampleNo + "(A)");
      LODOP.ADD_PRINT_HTM(20,10,750,220,style + "<body>" + $("#printHead").html()+ "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      LODOP.ADD_PRINT_TABLE(230,0,750,"BottomMargin:60px",style + "<body>" + $("#tableArea").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
};

//BankStatement
function printBankStatement(purchaseNo){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createBankStatement(LODOP,purchaseNo);
    LODOP.PRINT_DESIGN();
}


function createBankStatement(LODOP,purchaseNo){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
	  style = "<style>"+ style + "div{font-family:'楷体'}"+ "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"对帐单" + purchaseNo　+ "(A)");
      LODOP.ADD_PRINT_HTM(20,10,750,320, style + "<body>" +  $("#printHead").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      LODOP.ADD_PRINT_TABLE(380,10,750,"BottomMargin:25px",style + "<body>" + $("#tableArea").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
      
      LODOP.ADD_PRINT_HTM(10,0,750,100,style + "<body>" +$("#contractContent").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1);
      
      LODOP.ADD_PRINT_TEXT(1100,730,60,20,"#/&");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
}

//CommercialInvoice
function printCommercialInvoice(no){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createCommercialInvoice(LODOP,no);
    LODOP.PRINT_DESIGN();
}


function createCommercialInvoice(LODOP,no){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,""); 
	  style = "<style>"+ style + "div{font-family:'楷体'}"+ "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"商业发票" + no + "(A)");

      LODOP.ADD_PRINT_HTM(20,0,750,120, style + "<body>" +  $("#pageHead").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
       
      commonCommercialInvoiceContent(LODOP,style);
      
      LODOP.ADD_PRINT_HTM(1000,0,750,60, style + "<body>" + $("#pageFooter").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      LODOP.ADD_PRINT_TEXT(1100,730,60,20,"#/&");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
};

function printCommercialInvoiceOnLetterPaper(no){
   var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
   createCommercialInvoiceOnLetterPaper(LODOP,no);
   LODOP.PRINT_DESIGN();
}

function commonCommercialInvoiceContent(LODOP,style){
   LODOP.ADD_PRINT_HTM(120,0,750,350, style + "<body>" +  $("#printHead").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
   
   LODOP.ADD_PRINT_TABLE(515,0,750,"BottomMargin:25px",style + "<body>" + $("#tableArea").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
   
   LODOP.ADD_PRINT_HTM(20,0,750,600,style + "<body>" +$("#printFooter").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1);
   LODOP.SET_PRINT_STYLEA(0,"Vorient","3");
}

function createCommercialInvoiceOnLetterPaper(LODOP,no){
   var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,""); 
   style = "<style>"+ style + "div{font-family:'楷体'}"+ "</style>";
   LODOP.PRINT_INITA(1,0,793,1122,"商业发票" + no + "(B)");
   
   commonCommercialInvoiceContent(LODOP,style);
}

//ExpenseApply
function printExpenseApply(no){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createExpenseApply(LODOP,no);
    LODOP.PRINT_DESIGN();
}

function createExpenseApply(LODOP,no){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,"");
	  style = "<style>"+ style + "div{font-family:'楷体'}"+ "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"费用申请单" + no + "(A)");
      LODOP.ADD_PRINT_HTM(20,10,750,320, style + "<body>" +  $("#printHead").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      LODOP.ADD_PRINT_TABLE(200,10,750,"BottomMargin:25px",style + "<body>" + $("#tableArea").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
      
      LODOP.ADD_PRINT_HTM(10,0,750,100,style + "<body>" +$("#contractContent").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"LinkedItem",-1);
      
}

//Quotation
function printQuotation(no){
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
    createQuotation(LODOP,no);
    LODOP.PRINT_DESIGN();
}


function createQuotation(LODOP,no){
	  var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,""); 
	  style = "<style>"+ style + "</style>";
	  LODOP.PRINT_INITA(1,0,793,1122,"报价单" + no + "(A)");

      LODOP.ADD_PRINT_HTM(20,0,750,120, style + "<body>" +  $("#pageHead").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
       
      commonQuotationContent(LODOP,style);
      
      LODOP.ADD_PRINT_HTM(1000,0,750,60, style + "<body>" + $("#pageFooter").html() + "</body>");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
      
      LODOP.ADD_PRINT_TEXT(1100,730,60,20,"#/&");
      LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
};

function printQuotationOnLetterPaper(no){
   var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
   createCommercialInvoiceOnLetterPaper(LODOP,no);
   LODOP.PRINT_DESIGN();
}

function commonQuotationContent(LODOP,style){
   LODOP.ADD_PRINT_HTM(120,0,750,350, style + "<body>" +  $("#printHead").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
   
   LODOP.ADD_PRINT_TABLE(260,0,750,"BottomMargin:25px",style + "<body>" + $("#tableArea").html() + "</body>");
   LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
}

function createQuotationOnLetterPaper(LODOP,no){
   var style = $("#printStyle").html().toString().replace(/\r\n/g,"").replace(/\n/g,""); 
   style = "<style>"+ style + "</style>";
   LODOP.PRINT_INITA(1,0,793,1122,"报价单" + no + "(B)");
   
   commonQuotationContent(LODOP,style);
}
